package HomeWork.Chapter04.point;

/**
 * Enjoy programming!!!
 * Time: 2021/11/27 -  14:20
 */
import java.util.Scanner;

public class Point {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        double x = input.nextDouble();
        double y = input.nextDouble();
        double x1 = input.nextDouble();
        double y1 = input.nextDouble();

        MyPoint P1 = new MyPoint();
        MyPoint P2 = new MyPoint(x,y);
        MyPoint P3 = new MyPoint(x1,y1);

        System.out.printf("%.4f", P1.distance(P2));
        System.out.print("\n");
        System.out.printf("%.4f", MyPoint.distance(P2,P3));

    }

}
class MyPoint{
    private final double x;
    private final double y;

    public MyPoint(){
        x = 0;
        y = 0;
    }

    public MyPoint (double x, double y){
        this.x = x;
        this.y = y;
    }

    public double distance(MyPoint p1){
        return Math.sqrt(Math.pow(this.x - p1.x, 2) + Math.pow(this.y - p1.y, 2));
    }
    public static double distance(MyPoint p1, MyPoint p2){
        return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
    }
}
